@model IEnumerable<Rank>
@{
    Layout = "~/Views/Shared/_Dashboard.cshtml";
}
@UIHelper.ImageTitle(Html.Global("forums", "Ranks"), Html.Global("forums", "RanksTips"), "~/content/images/icon_ranks_48.png")
<div id="_rankslist">
    <div>@Ajax.Dna().Button().LocText("RES_NEW").Click("location=\"" + Url.Action("Create", "Rank", new { Area = "Community" }) + "\"").ImageIcons(Url.Content("~/content/images/icon_add_16.png")).GetHtml()</div>
    @{
        Ajax.Dna().Grid(Model)
          .Columns(cols =>
          {
              cols.Bound(m => m.Name).Title(Html.Global("RES_NAME")).Template(@<text> <a href="@Url.Action("Edit", "Rank", new { id = item.ID })" class="d-link">
                  @if (!string.IsNullOrEmpty(item.ImageUrl))
                  {
                      if (item.ImageUrl.StartsWith("%theme%"))
                      {
                      <img src="@Url.ThemeContent(item.ImageUrl.Replace("%theme%", ""))" alt="" />
                      }
                      else
                      {
                      <img src="@Url.Content(item.ImageUrl)" alt=""/>
                      }
                  }
                  @item.Name
              </a>
        </text>);
              cols.Bound(m => m.IsStart).Title(Html.Global("forums", "IsStart")).Width(80).Template(@<text>
        @if (item.IsStart)
        {
            <img src="@Url.Content("~/content/images/icon_accept_16.png")" alt="IsStartRank"/>
        }
        </text>);
              cols.Bound(m => m.MinimumPosts).Title(Html.Global("forums", "MinimumPosts")).TextAlign(System.Web.UI.WebControls.HorizontalAlign.Right).Width(100);
          })
          .Name("ForumRankListGrid")
          .Render();
    }
</div>
@Html.StartupScripts()
